package org.csmzxy.class2334;

class Animal{
    public void speak(){
        System.out.println("动物发出叫声");
    }
}
class Cat extends Animal{
    @Override
    public void speak() {
        System.out.println("小猫：喵喵……");
    }
}
class Dog extends Animal{
    @Override
    public void speak() {
        System.out.println("小狗：汪汪……");
    }
}
public class Example13 {
    public static void main(String[] args){
        Animal animal1=new Cat();
        Animal animal2=new Dog();
        animal1.speak();
        animal2.speak();
    }
}
